home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / TUT12.ZIP / TUT12.TXT < prev    next >
Text File  |  1994-07-22  |  13KB  |  300 lines

  1.                    ╒═══════════════════════════════╕
  2.                    │         W E L C O M E         │
  3.                    │  To the VGA Trainer Program   │ │
  4.                    │              By               │ │
  5.                    │      DENTHOR of ASPHYXIA      │ │ │
  6.                    ╘═══════════════════════════════╛ │ │
  7.                      ────────────────────────────────┘ │
  8.                        ────────────────────────────────┘
  9.  
  10.                            --==[ PART 12 ]==--
  11.  
  12.  
  13.  
  14. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  15. ■ Introduction
  16.  
  17. Hello! :-)
  18.  
  19. Well, a lot has happened since the last trainer, which is the reason for
  20. the amazingly long delay. First, the elections. These were quite easy
  21. actually, I went and watched a move (Demolition Man) (Election day
  22. special, all movies R2, which is about 50 US cents), then went and voted
  23. after most voters had gone home, so no long lines ;-). Soon after were
  24. exams. These did not go too well, and I am not looking forward to the
  25. results. Finally, I got measles and pneumonia at the same time and was
  26. sent off to hospital for a few days. All in all, not events which are
  27. conducive to coding! This has meant that the trainer has been delayed,
  28. and ASPHYXIA was not able to enter into the local democompo, Dexterity
  29. '94, which we were hoping to do well in. Oh well, onward and upward!
  30.  
  31. This trainer is on full screen scrolling in Chain-4, by request. This is
  32. actually very easy to do (and smooth), and holds a lot of potential, as
  33. I am sure you can immediately imagine.
  34.  
  35. A few more things : People have been saying they have had hassles
  36. sending me email, and I have found that this is because they forget the
  37. numbers in my name. They send mail to smith@batis... which does not
  38. exist, or smith@beastie... which is my brothers account. He is getting a
  39. bit sick of forwarding my mail to me ;). The two address are :
  40.        smith9@batis.bis.und.ac.za
  41.        smith0@beastie.cs.und.ac.za
  42.  
  43. I have lost about 200k worth of email, chalk it up to my beginner status
  44. at Unix. The test to see if your mail got through? I have answered
  45. _every_ email message sent to me (no easy task), so if you haven't got a
  46. reply, please resend the message.
  47.  
  48. You can now also send a group message to all members of Asphyxia. Just
  49. send mail to asphyxia@beastie.cs.und.ac.za and we will all get a copy
  50. ... which could mean numerous replies to one querey ;)
  51.  
  52.  
  53. If you would like to contact me, or the team, there are many ways you
  54. can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail
  55.                   on the ASPHYXIA BBS.
  56.             2) Write to Denthor, EzE, Goth, Fubar or Nobody on Connectix.
  57.             3) Write to :  Grant Smith
  58.                            P.O.Box 270 Kloof
  59.                            3640
  60.                            Natal
  61.                            South Africa
  62.             4) Call me (Grant Smith) at (031) 73 2129 (leave a message if you
  63.                   call during varsity). Call +27-31-73-2129 if you call
  64.                   from outside South Africa. (It's YOUR phone bill ;-))
  65.             5) Write to smith9@batis.bis.und.ac.za in E-Mail.
  66.             6) Write to asphyxia@beastie.cs.und.ac.za
  67.  
  68. NB : If you are a representative of a company or BBS, and want ASPHYXIA
  69.        to do you a demo, leave mail to me; we can discuss it.
  70. NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling
  71.         quite lonely and want to meet/help out/exchange code with other demo
  72.         groups. What do you have to lose? Leave a message here and we can work
  73.         out how to transfer it. We really want to hear from you!
  74.  
  75.  
  76.  
  77. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  78. ■  What is full screen scrolling?
  79.  
  80. I seem to recall doing this in a previous tut, but here goes again! Full
  81. screen scrolling is when the entire screen moves in a particular
  82. direction, with the new picture scrolling on to the screen. Um. Think of
  83. movie credits. The screen, filled with text, is scrolled off the top of
  84. the screen while the new text is scrolled on from the bottom. This is
  85. full screen scrolling.
  86.  
  87. Full screen scrolling is not limited to movie credits. Games like Raptor
  88. have you flying over a scrolling landscape while you are shooting down
  89. the bad guys. In this tutorial we will be doing vertical scrolling, but
  90. the code can very easily be altered for horizontal scrolling too.
  91.  
  92. Remember that we will be using Chain-4 to do our scrolling, so you may
  93. want to brush up on tut 10 in which that was covered. I will assume a
  94. brief knowledge of how chain-4 works for this tutorial.
  95.  
  96.  
  97. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  98. ■  The theory
  99.  
  100. The theory behind full screen scrolling in Chain-4 is acually very
  101. simple.
  102.  
  103. Picture if you will, a screen that is two monitors high. Chain-4
  104. actually has four, but for this we only need two. Now, for this screen
  105. that is two monitors high, we can only see one monitors worth. Here it
  106. is in ASCII
  107.  
  108.     +-------------+  Screen two monitors high
  109.     |             |
  110.     |             |
  111.     |             |
  112.     |             |
  113.     |+-----------+|
  114.     ||           ||
  115.     ||           ||<- This is the bit we can see, one monitors worth
  116.     ||           ||
  117.     |+-----------+|
  118.     +-------------+
  119.  
  120. We can move the bit we can see up or down the enlarged screen. So, for
  121. example, if the screen two monitors high had a picture on it, we could
  122. move the bit we see up and down to try glimpse the entire picture. Think
  123. of it in this way : The screen is a large painting, but we can only see
  124. though a small magnifing glass. We can move this magnifing glass around
  125. the painting, but can never see the painting all at once.
  126.  
  127. This actually works in our favour. Anything done outside the bit we are
  128. looking through cannot be seen, so we can do our work without changing
  129. our screen.
  130.  
  131. On to scrolling. The method we will use this time is as follows :
  132.  
  133. 1) Draw the next line to be seen just above and just below the part we
  134.    can see.
  135.  
  136.       +------------+ The enlarged screen
  137.       |            |
  138.       |            |
  139.       |111111111111|  The new part of the picture
  140.       |+----------+|
  141.       ||          || The bit we can see
  142.       |+----------+|
  143.       |111111111111|  The new part of the picture
  144.       +------------+
  145.  
  146. 2) Move the view up one pixel so that the new part of the picture is
  147.    visible at the top of the screen.
  148.  
  149. 3) Repeat Steps 1) and 2) until the whole screen is filled. Our screen
  150.    will look as follows :
  151.  
  152.      +---------------+
  153.      |+-------------+|
  154.      ||3333333333333||
  155.      ||2222222222222|| Viewscreen
  156.      ||1111111111111||
  157.      |+-------------+|
  158.      |333333333333333|
  159.      |222222222222222|
  160.      |111111111111111|
  161.      +---------------+
  162.  
  163. Check this picture with steps 1) and 2), you will see that this is
  164. correct.
  165.  
  166. 4) Set our viewport to the bottom of the enlarged screen.
  167.  
  168.      +---------------+
  169.      |333333333333333|
  170.      |222222222222222|
  171.      |111111111111111|
  172.      |+-------------+|
  173.      ||3333333333333||
  174.      ||2222222222222|| New position of viewscreen
  175.      ||1111111111111||
  176.      |+-------------+|
  177.      +---------------+
  178.  
  179. As you can see, the bit we will be looking at is exactly the same as
  180. before, we are now just at the bottom of the larger screen instead of
  181. the top!
  182.  
  183. 5) Jump back to 1). The entire sequence can begin again, and we can have
  184.    infinate scrolling in the upward direction. Clever huh?
  185.  
  186.  
  187. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  188. ■  Our code
  189.  
  190. In the sample code, we have 21 different icons. What we do is decide
  191. what the next row of icons is going to consist of. We then draw the next
  192. line of pixels above and below the viewscreen according to what icons we
  193. are displaying. We then scroll up one pixel and begin again. When we
  194. have completed a row of icons, we randomly select a new row and begin
  195. again. Our icons are 16x16, so exactly 20 fit across a 320 pixel screen.
  196.  
  197. When we hit the top of our enlarged screen, we flip down to the bottom
  198. which looks exactly the same as the screen we have left. In this manner
  199. we have obtained smooth, infinate full screen scrolling!
  200.  
  201.  
  202. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  203. ■  Extra bits
  204.  
  205. As you will see from the code, it would be the work of but a few minutes
  206. to extend our landscape across the two unused screens, thereby allowing
  207. limited horizontal movement along with our vertical movement. In fact,
  208. the entire routine could easily be made to be a horizontal scrolling
  209. routine.
  210.  
  211. A map of sorts could be generated, with one byte equalling one terrain
  212. type. In this manner, the terrain scrolled over could be set, as in a
  213. flying game (Flying Shark, Raptor etc). The terrain could also easily be
  214. replaced with letters for our movie-style credits.
  215.  
  216. Free direction scrolling, ie scrolling in all directions, is a very
  217. different matter, with very different methods to get it to work. Perhaps
  218. this will be discussed in a later trainer. But for now, work with this,
  219. know it, understand it, and think up many great things to do with it!
  220. How about a full screen text scrolly? A game? Go wild!
  221.  
  222.  
  223. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  224. ■  In closing
  225.  
  226. Well, I hope you enjoyed this, the latest trainer. The sample program is
  227. a little short, but that is because the concept is so simple. Attached
  228. is a file, PICCS.DAT, which contains the terrain and letters for the
  229. sample program. They were .CEL's, which I loaded into the des^ variable,
  230. which I then dumped to disk, for easy access later. The .CEL's were
  231. drawn on short notice, but still produces some nice terrain.
  232.  
  233. I have recieved a few requests for future trainers, and most of them are
  234. for effects, so I guess that is what will be done from now on. A
  235. surprising number have told me not to do a sound trainer and stick with
  236. graphics stuff, with only a few asking for sound stuff, so I will hold
  237. off on that until there is more of a demand.
  238.  
  239. I am still open to suggestions for future trainers, and of course
  240. suggestions for improving the series. Leave me mail!
  241.  
  242. Hmm. A quote? Okay, let me think ....
  243.  
  244.         [    The little devil sat atop the alpine slopes, frolicking in the
  245.            snow.  He threw a snowball at a nearby squirrel, which
  246.            missed. The resulting avalance buried two villages and a ski
  247.            resort.
  248.              The little devil was scared. Avalances were bad for
  249.            business. The locals would form team spirit, be nice to
  250.            each other and work together and free those trapped beneath
  251.            the snow, which created even more goodwill. The man
  252.            downstairs didn't like goodwill. He didn't like it at
  253.            all.
  254.              In the blink of an eye the devil was in his penthouse
  255.            apartment, dressed in his usual suit. He picked up the phone.
  256.            Dialing was for mortals.
  257.              "Hello, Micros..."
  258.              "This is Mister Crowley", interrupted the devil.
  259.              There were sounds of thumping on the other side of the
  260.            phone, then there was a new voice. "Hello, Bill here, we
  261.            haven't heard from you in a while, Mister Crowley." The fear
  262.            of the man on the other end was almost tangible. The devil
  263.            smiled.
  264.              "Hello Bill. Something has come up."
  265.              "No!" The man on the other side almost shouted with terror.
  266.            "Not Win..."
  267.              "Yes, Bill. It is time."
  268.              "Havn't I paid enough for my sins? Just that one night..."
  269.            The man was almost sobbing.
  270.              "You are touching me, Bill. But nevertheless, it is time."
  271.              "No." The man sounded beaten, alone.
  272.              "Yes. Bill, it is time for a new update."
  273.                                                                        ]
  274.                                                       - Grant Smith
  275.                                                           14:23
  276.                                                             23-7-94
  277.  
  278. See you next time!
  279.   - Denthor
  280.  
  281. The following are official ASPHYXIA distribution sites :
  282.  
  283. ╔══════════════════════════╦════════════════╦═════╗
  284. ║BBS Name                  ║Telephone No.   ║Open ║
  285. ╠══════════════════════════╬════════════════╬═════╣
  286. ║ASPHYXIA BBS #1           ║+27-31-765-5312 ║ALL  ║
  287. ║ASPHYXIA BBS #2           ║+27-31-765-6293 ║ALL  ║
  288. ║C-Spam BBS                ║410-531-5886    ║ALL  ║
  289. ║Connectix BBS             ║+27-31-266-9992 ║ALL  ║
  290. ║POP!                      ║+27-12-661-1257 ║ALL  ║
  291. ║Pure Surf BBS             ║+27-31-561-5943 ║A/H  ║
  292. ║Soul Asylum               ║+358-0-5055041  ║ALL  ║
  293. ║Wasted Image              ║407-838-4525    ║ALL  ║
  294. ╚══════════════════════════╩════════════════╩═════╝
  295.  
  296. Leave me mail if you want to become an official Asphyxia BBS
  297. distribution site.
  298.  
  299.  
  300.